<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>无标题文档</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
<script>
	window.onload=function(){
			var idx=0;
			setTimeout(function(){
					if(idx==1){
							return;
						}
					var ele=document.createElement("button");
					ele.innerHTML="js创建的脚本";
					ele.setAttribute("id","btn2");
					ele.setAttribute("onclick","javascript:alert('aaa')");
					document.getElementById("contain").appendChild(ele)
					idx=1;
				},2000)
		}
</script>
<body>
	<div id="contain">
    	<button id="btn1">该页面原有的按钮</button>
    </div>
</body>
</html>
